<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"
    import="java.sql.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>會員詳細資料</title>
</head>
<body>
<% if(session.getAttribute("access") == "y" ){%>
<jsp:useBean id="mydb" scope="page" class="bean.ConDbBean"/>
<% 
	  String sql="select * from MEMBER WHERE M_NUM='"+request.getParameter("num")+"'";
	  ResultSet rs=mydb.executeQuery(sql);
	  rs.next();
	 // String Mnum = rs.getString(1);
	  String Mid = rs.getString(2);
      String Mname = rs.getString(3);
	  String sex = rs.getString(5);
	  if(sex.equalsIgnoreCase("M"))
	  sex="男";
	  else
	  sex="女";
	  String address = rs.getString(6);
	  String reg_date = rs.getString(7);
      String phone = rs.getString(8);
      String email = rs.getString(9);
	  String dep = rs.getString(10);
	  String por_name = rs.getString(11);
	  String level = rs.getString(12);
	   if(level.equalsIgnoreCase("1"))
	  level ="會員";
	  else if(level.equalsIgnoreCase("2"))
	  level ="管理者";
	  else
	  level ="違規會員";
	  
%>

<table width="600"  border="1" align="center" cellpadding="1" cellspacing="1" bordercolor="#999999">
                <div align="center">  會員詳細資料                </div>
                <tr bgcolor="#FFFFCC">
                  <td width="23%"><div align="right"><span class="gytext11"><font class=cherry></font>帳號：</span></div></td>
                  <td width="77%"><div align="left"><span class="lggytext11"><%=Mid%> 
                  </span></div></td>
                </tr>
                <tr>
                  <td><div align="right"><span class="gytext11"><font class=cherry></font>姓名：</span></div></td>
                  <td><div align="left"><span class="lggytext11"><%=Mname%>
                  </span></div></td>
                </tr>
                <tr bgcolor="#FFFFCC">
                  <td><div align="right"><span class="gytext11">性別：</span></div></td>
                  <td><div align="left"><span class="lggytext11"><%=sex%>
                  </span></div></td>
                </tr>
                <tr>
                  <td><div align="right"><span class="gytext11">聯絡電話：</span></div></td>
                  <td><div align="left"><span class="lggytext11"><%=phone%>
                    </span></div></td>
                </tr>
                <tr bgcolor="#FFFFCC">
                  <td><div align="right"><span class="gytext11">聯絡地址：</span></div></td>
                  <td><div align="left"><span class="lggytext11"><%=address%>
                  </span></div></td>
                </tr>
                <tr>
                  <td><div align="right">E-mail：</div></td>
                  <td><div align="left"><span class="lggytext11"><%=email%>
                  </span></div></td>
                </tr>
                <tr bgcolor="#FFFFCC">
                  <td><div align="right">部門：</div></td>
                  <td><div align="left"><span class="lggytext11"><%=dep%>
                  </span></div></td>
                </tr>
                <tr>
                  <td><div align="right">職稱：</div></td>
                  <td><div align="left"><span class="lggytext11"><%=por_name%>
                  </span></div></td>
                </tr>
                <tr bgcolor="#FFFFCC">
                  <td><div align="right">權限：</div></td>
                  <td><div align="left"><span class="lggytext11"><%=level%> 
                  </span></div></td>
                </tr>
                <tr>
                  <td><div align="right">註冊時間：</div></td>
                  <td><div align="left"><span class="lggytext11"><%=reg_date%>
                  </span></div></td>
                </tr>
              </table>
 

<%
  }
  else{
  	response.sendRedirect("../index.jsp"); //若沒有登入則回到index.jsp
  } 
  %>
</body>
</html>